home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / CAD / PADSLOG.ARJ / LOGIC.EXE / PSHEADER.DAT < prev    next >
Text File  |  1991-04-20  |  10KB  |  440 lines

  1. %!PS-Adobe-2.0
  2. %%Title: PADS Postscript Driver Header
  3. %%Creator: Andy Montalvo, 18 Lupine St., Lowell, MA  01851
  4. %%CreationDate: 06/08/90
  5. %%For: CAD Software, Littleton, MA
  6. %%EndComments
  7. %%BeginProcSet: Markers 1.0 0
  8. % marker attributes
  9. /MAttr_Width 1 def
  10. /MAttr_Size  0 def
  11. /MAttr_Type /M1 def
  12. % procedures
  13. /M1 { %def
  14. % draw marker 1: plus
  15. % Stack: - M1 -
  16.     -2 0 rmoveto
  17.     4 0 rlineto
  18.     -2 2 rmoveto
  19.     0 -4 rlineto
  20. } bind def
  21. /M2 { %def
  22. % draw marker 2: cross
  23. % Stack: - M2 -
  24.     -2 -2 rmoveto
  25.     4 4 rlineto
  26.     -4 0 rmoveto
  27.     4 -4 rlineto
  28. } bind def
  29. /M3 { %def
  30. % draw marker 3: square
  31. % Stack: - M3 -
  32.     0 2 rlineto
  33.     2 0 rlineto
  34.     0 -4 rlineto
  35.     -4 0 rlineto
  36.     0 4 rlineto
  37.     2 0 rlineto
  38. } bind def
  39. /M4 { %def
  40. % draw marker 4: diamond
  41. % Stack: - M4 -
  42.     0 2 rlineto
  43.     2 -2 rlineto
  44.     -2 -2 rlineto
  45.     -2 2 rlineto
  46.     2 2 rlineto
  47. } bind def
  48. /M5 { %def
  49. % draw marker 5: hourglass
  50. % Stack: - M5 -
  51.     2 2 rlineto
  52.     -4 0 rlineto
  53.     4 -4 rlineto
  54.     -4 0 rlineto
  55.     2 2 rlineto
  56. } bind def
  57. /M6 { %def
  58. % draw marker 6: bowtie
  59. % Stack: - M6 -
  60.     2 2 rlineto
  61.     0 -4 rlineto
  62.     -4 4 rlineto
  63.     0 -4 rlineto
  64.     2 2 rlineto
  65. } bind def
  66. /M7 { %def
  67. % draw marker 7: small plus (goes with char marker)
  68. % Stack: - M7 -
  69.     -1 0 rmoveto
  70.     2 0 rlineto
  71.     -1 1 rmoveto
  72.     0 -2 rlineto
  73. } bind def
  74. /Marker { %def
  75. % Command from driver: draw marker
  76. % STACK: x y Marker -
  77.     MAttr_Size 0 gt
  78.     {
  79.         gsave
  80.         moveto
  81.         MAttr_Size 4 div dup scale
  82.         MAttr_Type load exec
  83.         4 MAttr_Size div dup scale
  84.         MAttr_Width setlinewidth
  85.         stroke
  86.         grestore
  87.     } if
  88. } def
  89. %%EndProcSet: Markers 1.0 0
  90. %%BeginProcSet: Lib 1.0 0
  91. /sg { %def
  92. % Command from driver: set the gray scale 0 - 100
  93. % STACK: greylevel sg
  94.     100 div dup setgray /glev exch def
  95. } bind def
  96. /Circle { %def
  97. % draw a circle
  98. % STACK: x y radius Circle -
  99.     0 360 arc
  100. } bind def
  101. /RndAper { %def
  102. % select a round aperture
  103. % STACK: - RndAper -
  104.     1 setlinejoin
  105.     1 setlinecap
  106. } bind def
  107. /SqrAper { %def
  108. % select a square aperture
  109. % STACK: - SqrAper -
  110.     0 setlinejoin
  111.     2 setlinecap
  112. } bind def
  113. /Line { %def
  114. % draw a set of connected lines
  115. % STACK: x1 y1 [ x2 y2 ... xn yn ] Line -
  116.     3 1 roll
  117.     moveto
  118.     true
  119.     exch
  120.     % This pushes the x then the y then does lineto
  121.     { exch  { false } { lineto true } ifelse } forall
  122.     pop
  123. } bind def
  124. /Clipto { %def
  125. % set clipping rectangle from 0,0 to new values
  126. % STACK: x y Clipto -
  127.     0 0 moveto
  128.     dup 0 exch lineto
  129.     2 copy lineto
  130.     pop
  131.     0 lineto
  132.     closepath
  133.     clip
  134.     newpath
  135. } bind def
  136. /Clip4 { %def
  137. % set clipping rectangle from xmin,ymin to xmax,ymax
  138. % STACK: xmin ymin xmax ymax Clip4 -
  139.     4 copy pop pop moveto
  140.     4 copy pop exch lineto pop
  141.     2 copy lineto
  142.     exch pop exch pop lineto
  143.     closepath
  144.     clip
  145.     newpath
  146. } bind def
  147. %%EndProcSet: Lib 1.0 0
  148. %%BeginProcSet: Lines 1.0 0
  149. % line attributes %
  150. /LAttr_Width 1 def
  151. % line procedures
  152. /PLine { %def
  153. % Cammand from driver: draw a set of connected lines
  154. % STACK: x1 y1 [ x2 y2 ... xn yn ] PLine -
  155.     Line
  156.     LAttr_Width setlinewidth
  157.     stroke
  158. } bind def % PLine
  159. /Char { %def
  160. % Command from driver: draw a character at the current position
  161. % STACK: type x y stroke_array Char -
  162. %    stroke array -- [ stroke1 stroke2 ... stroken ]
  163. %    stroke -- connected staight lines
  164. %    type = 0 if text  1 if marker
  165.     gsave
  166.     4 1 roll
  167.     translate
  168.     0 eq { TAttr_Width } { MAttr_Width } ifelse setlinewidth
  169.     {
  170.         dup length 2 gt
  171.         {
  172.             dup dup 0 get exch 1 get % get starting point
  173.             3 -1 roll                % put x y before array
  174.             dup length 2 sub 2 exch getinterval % delete first items from array
  175.             Line
  176.             stroke
  177.         }
  178.         {
  179.             aload pop currentlinewidth 2 div Circle fill
  180.         } ifelse
  181.     } forall
  182.     grestore
  183. } bind def % Char
  184. /PArc { %def
  185. % Command from driver: draw an arc
  186. % STACK: x y radius startangle deltaangle Arc -
  187.      10 div exch 10 div exch
  188.     2 copy pop add
  189.     arc
  190.     LAttr_Width setlinewidth
  191.     stroke
  192. } bind def
  193. /PCircle { %def
  194. % Command from driver: draw an circle
  195. % STACK: x y radius PCircle -
  196.     Circle
  197.     LAttr_Width setlinewidth
  198.     stroke
  199. } bind def
  200. %%EndProcSet: Lines 1.0 0
  201. %%BeginProcSet: Polygon 1.0 0
  202. % polygon attributes %
  203. /PAttr_ExtWidth 1 def
  204. /PAttr_IntWidth 1 def
  205. /PAttr_Grid 1 def
  206. % polygon procedures
  207. /LoopSet { %def
  208. % set up for loop condition
  209. % STACK: start end LoopSet low gridwidth high
  210.     2 copy lt { exch } if
  211.     % make grid line up to absolute coordinates
  212.     PAttr_Grid div truncate PAttr_Grid mul exch
  213.     PAttr_Grid exch
  214. } bind def
  215. /Hatch { %def
  216. % draw cross hatch pattern in current path
  217. % STACK: - Hatch -
  218.     pathbbox
  219.     /ury exch def
  220.     /urx exch def
  221.     /lly exch def
  222.     /llx exch def
  223.     clip
  224.     newpath
  225.     llx urx LoopSet
  226.     { % x loop
  227.         dup lly exch ury moveto lineto
  228.     } for
  229.     lly ury LoopSet
  230.     { % y loop
  231.         llx exch dup urx exch moveto lineto
  232.     } for
  233.     PAttr_IntWidth setlinewidth
  234.     stroke
  235. } bind def
  236. /PPoly { %def
  237. % Command from driver: draw a plygon
  238. % STACK: x1 y1 [ x2 y2 ... xn yn ] PLine -
  239.     Line
  240.     closepath
  241.     gsave
  242.     PAttr_IntWidth PAttr_Grid ge {fill} {Hatch} ifelse
  243.     grestore
  244.     PAttr_ExtWidth setlinewidth
  245.     stroke
  246. } bind def
  247. %%EndProcSet: Polygon 1.0 0
  248. %%BeginProcSet: Text 1.0 0
  249. % text attributes %
  250. /TAttr_Mirr 0 def
  251. /TAttr_Orient 0 def
  252. /TAttr_Width 1 def
  253. % text procedures
  254. /Text { %def
  255. % Command from driver: Draw text
  256. % STACK: x y width string Text -
  257.     gsave
  258.     4 2 roll
  259.     translate
  260.     TAttr_Mirr 0 gt
  261.     {
  262.         -1 1 scale
  263.     } if
  264.     TAttr_Orient rotate
  265.     0 0 moveto
  266.     dup length dup 1 gt
  267.     {
  268.         exch dup stringwidth pop
  269.         4 -1 roll
  270.         exch 2 copy
  271.         lt
  272.         {
  273.             div 1 scale show
  274.         }
  275.         {
  276.             sub
  277.             3 -1 roll 1 sub div
  278.             0 3 -1 roll ashow
  279.         }
  280.         ifelse
  281.     }
  282.     {
  283.         pop
  284.         show
  285.     } ifelse
  286.     grestore
  287. } bind def
  288. %%EndProcSet: Text 1.0 0
  289. %%BeginProcSet: FlashSymbols 1.0 0
  290. % flash symbol attributes %
  291. /FAttr_Type /PRndPad def
  292. /FAttr_Width  0 def
  293. /FAttr_Length 1 def
  294. /FAttr_Orient 0 def
  295. % flash symbol procedures
  296. /PRndPad { %def
  297. % Command from driver: draw an circular pad
  298. % STACK: - PCirclePad -
  299.     FAttr_Width dup scale
  300.     0 0 .5 Circle
  301.     fill
  302. } bind def
  303. /PSqrPad { %def
  304. % Draw an Square pad
  305. % STACK: - PRectPad -
  306.     FAttr_Width dup scale
  307.     .5 .5 moveto
  308.     -.5 .5 lineto
  309.     -.5 -.5 lineto
  310.     .5 -.5 lineto
  311.     closepath
  312.     fill
  313. } bind def
  314. /PRectPad { %def
  315. % Draw an rectangular pad
  316. % STACK: - PRectPad -
  317.     FAttr_Length FAttr_Width scale
  318.     .5 .5 moveto
  319.     -.5 .5 lineto
  320.     -.5 -.5 lineto
  321.     .5 -.5 lineto
  322.     closepath
  323.     fill
  324. } bind def
  325. /POvalPad { %def
  326. % Draw an oval pad
  327. % STACK: - POvalPad -
  328.     FAttr_Width setlinewidth
  329.     FAttr_Length FAttr_Width sub 2 div dup
  330.     neg 0 moveto
  331.     0 lineto
  332.     RndAper
  333.     stroke
  334. } bind def
  335. /Anl { %def
  336.     0 0 .5 Circle
  337.     fill
  338.     FAttr_Length FAttr_Width lt
  339.     { % inner circle
  340.         0 0
  341.         FAttr_Length 0 gt { FAttr_Length FAttr_Width div } { .5 } ifelse
  342.         2 div Circle
  343.         1 setgray
  344.         fill
  345.         glev setgray
  346.     } if
  347. } bind def
  348. /PAnlPad { %def
  349. % Draw an annular pad
  350. % STACK: - PAnlPad -
  351.     FAttr_Width dup scale
  352.     Anl
  353. } bind def
  354. /PRelPad { %def
  355. % Draw an thermal relief pad
  356. % STACK: - PRelPad -
  357.     PAnlPad
  358.     1 setgray
  359.     .17 setlinewidth
  360.     0 setlinecap   % the x
  361.     45 rotate
  362.     .5 0 moveto -.5 0 lineto
  363.     0 .5 moveto  0 -.5 lineto
  364.     stroke
  365.     glev setgray
  366. } bind def
  367. /Flash { %def
  368. % Command from driver: Flash a symbol
  369. % STACK: x y Flash -
  370.     FAttr_Width 0 gt
  371.     {
  372.         gsave
  373.         translate
  374.         FAttr_Orient rotate
  375.         FAttr_Type load exec
  376.         grestore
  377.     } if
  378. } def
  379. %%EndProcSet: FlashSymbols 1.0 0
  380. %%BeginProcSet: SetAttr 1.0 0
  381. /SetLine { %def
  382. % Set the width of the lines
  383. % STACK: linewidth SetLine -
  384.     /LAttr_Width exch def
  385.     RndAper
  386. } bind def
  387. /SetPoly { %def
  388. % Set attribute of polygon
  389. % STACK: external_width internal_grid_width grid_spacing SetPoly -
  390.     /PAttr_Grid exch def
  391.     /PAttr_IntWidth exch def
  392.     /PAttr_ExtWidth exch def
  393.     RndAper
  394. } bind def
  395. /SetFlash { %def
  396. % Set Attributed of flash pad
  397. % STACK: orientation_angle length width aperture_type SetFlash -
  398.     /FAttr_Type exch def
  399.     FAttr_Type /PSqrPad eq FAttr_Type /PRectPad eq or
  400.     { SqrAper } { RndAper } ifelse
  401.     /FAttr_Width exch def
  402.     /FAttr_Length exch def
  403.     /FAttr_Orient exch 10 div def
  404. } bind def
  405. /SetMkr { %def
  406. % Set attributes of markers
  407. % STACK: linewidth size type SetMkr -
  408.     /MAttr_Type exch def
  409.     /MAttr_Size exch def
  410.     /MAttr_Width exch def
  411.     RndAper
  412. } bind def
  413. /SetText1 { %def
  414. % Set attributes of text
  415. % STACK: fontname height orient mirror SetMkr -
  416.     /TAttr_Mirr exch def
  417.     /TAttr_Orient exch 10 div def
  418.     exch findfont exch scalefont setfont
  419.     RndAper
  420. } bind def
  421. /SetText2 { %def
  422. % Set attributes of text
  423. % STACK: linewidth height mirror orient SetMkr -
  424.     /TAttr_Width exch def
  425.     RndAper
  426. } bind def
  427. %%EndProcSet: SetAttr 1.0 0
  428. %%BeginProcSet: Initialize 1.0 0
  429. /Init { %def
  430. % Initialize the driver
  431. % STACK: Init -
  432.     72 1000 div dup scale % Scale to 1/1000 inch
  433.     250 250 translate     % make origin 1/4 inch from bottom left
  434.     1.5 setmiterlimit 1 RndAper                     % set line defaults
  435.     0 setgray                                       % set color default
  436.     /glev 0 def
  437. } def
  438. %%EndProcSet: Initialize 1.0 0
  439. %%EndProlog
  440.